package ro.imc.andrei.beans;

public class Course {
	
	private String courseName;
	private boolean mandatory;
	private int courseId;
	private int semester;	
	private int yearOfStudy;
	
	public int getYearOfStudy() {
		return yearOfStudy;
	}
	public void setYearOfStudy(int yearOfStudy) {
		this.yearOfStudy = yearOfStudy;
	}
	public String getCourseName() {
		return courseName;
	}
	public void setCourseName(String name) {
		this.courseName = name;
	}
	public boolean isMandatory() {
		return mandatory;
	}
	public void setMandatory(boolean mandatory) {
		this.mandatory = mandatory;
	}
	public int getCourseId() {
		return courseId;
	}
	public void setCourseId(int id) {
		this.courseId = id;
	}
	public int getSemester() {
		return semester;
	}
	public void setSemester(int semester) {
		this.semester = semester;
	}
	
	public String[] getFields(){
		String[] fields = new String[5];
		int i=0;
		
		fields[i++] = "courseId";
		fields[i++] = "courseName";
		fields[i++] = "mandatory";
		fields[i++] = "semester";
		fields[i++] = "yearOfStudy";
		
		return fields;
	}
	
	public String[] getValues(){
		String[] values = new String[5];
		int i = 0;
		
		values[i++] = Integer.toString(this.getCourseId());
		values[i++] = this.getCourseName();
		
		if(this.isMandatory())
			values[i++] = "Yes";
		else
			values[i++] = "No";
		
		values[i++] = Integer.toString(this.getSemester());
		values[i++] = Integer.toString(this.getYearOfStudy());
		
		return values;
	}
}
